import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/util/online-tool/base/list',
    method: 'get',
    params: query
  })
}

export function fetchOnlineTool(id) {
  return request({
    url: '/util/online-tool/base/one',
    method: 'get',
    params: { id }
  })
}

export function createOnlineTool(data) {
  return request({
    url: '/util/online-tool/base',
    method: 'post',
    data
  })
}

export function updateOnlineTool(data) {
  return request({
    url: '/util/online-tool/base',
    method: 'put',
    data
  })
}

export function createOrUpdateOnlineTool(data) {
  return request({
    url: '/util/online-tool/base/save-or-update',
    method: 'post',
    data
  })
}

export function deleteOnlineTool(id) {
  return request({
    url: '/util/online-tool/base/' + id,
    method: 'delete'
  })
}
